Repository navigation
opencode: follow the session's model in the plugin's own calls - #243
Open
Have-Purple wants to merge 1 commit into
Open
Have-Purple wants to merge 1 commit into
Have-Purple wants to merge 1 commit into
Conversation
With neither opencode_paid_model nor paid_model set, a side call ran 'opencode run' with no --model and took the CLI's configured default. That default can be a free model the session has already moved past; the free tier's 429 then looked like the plugin was broken while the session ran fine on a paid provider. The 2.x plugin now reports the model from session.step.started (provider/model#variant) with each hook; the session state keeps it, and the loop guard's judge and the micro-skills proposer use it where no paid_model is set. An explicit paid_model still wins, and the other hosts keep their own defaults (Claude's haiku): the fallback is opencode-only. The fold takes the model from the session state only: the session log keeps a bare model id, which 'opencode run --model' cannot resolve (it wants provider/model), so it is not a source. The usage read stays after ctx.host.settle() (Copilot writes it in the SessionEnd tail), and the model reaches the call through runner_for(role=..., session_model=...), as microsoft#185 landed. plugin/README.md and docs/PLUGIN.md say what a 2.x call runs on with no paid model configured.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With neither
opencode_paid_modelnorpaid_modelset, the plugin ranopencode runwith no--model, so TE used the CLI's configured default. That default can be a free model the sessionhas already moved past — the resulting 429s looked like TE being broken while the session was
running fine on a paid provider.
The 2.x plugin now reports the model from
session.step.startedasprovider/model#variantwitheach hook. The session state keeps it; the loop guard's judge and the micro-skills proposer use
it when no
paid_modelis set. An explicitpaid_modelstill wins, and the other hosts keeptheir own defaults (Claude's
haiku) — the fallback is opencode-only.This is the second half of what was #230; the quiet hand-over is now its own PR (#230).
Review items addressed
settle.fold.pyreadssession_usageafterctx.host.settle(transcript)again: Copilot writes usage in the SessionEnd tail, and readingahead of it recorded
requests: 0.trace/opencode.py), whichopencode run --modelcannot resolve (it wantsprovider/model), and the 1.xserverentrysends none. The fold takes the model from the session state only; the test that asserted the
bare id is replaced by one that would fail if the log were used (its log names another model).
583fff7. The model travels throughrunner_for(role=..., session_model=...)alongside the
role=argument plugin: run the loop guard's judge on Apple's on-device model (local_model=fm) #185 added, and the proposer keeps thelocal_runnerfallbackmicroskills: add
te microskills forget/unforget#160 introduced.Design note
This changes what side calls cost: they run on the session's own model and variant (
#highincluded), where the optimizer was described as the cheapest capable model.
plugin/README.mdand
docs/PLUGIN.mdnow say what a 2.x call runs on with no paid model configured. The quiethand-over — the rest of what was #230 — is that PR, so this can be discussed on its own.
Tests
session.step.startedwith its hooks (end-to-end underopencode's runtime);
paid_modelwins,Claude stays
haiku;Verification
opencode 2.3.0, Python 3.15, Windows. Offline suite: 1171 passed, 36 skipped, 0 failed. The
plugin's non-service tests pass, including the new model one. The two
opencode servicetestsfail on this machine on
mainas well (baseline re-run at583fff7), so they are not evidenceabout this change; CI runs them on the pinned 2.2.5.